package edu.pku.hawk.cloud.model;

import java.util.ArrayList;
import java.util.List;

public class XenResource {
	private int id;
	private String nodeLabel;
	private String name;
	private String description;
	private int type;
	private ResourcePrototype resourcePrototype;

	private List<XenResource> children;

	public List<XenResource> getChildren() {
		return children;
	}

	public void setChildren(List<XenResource> children) {
		this.children = children;
	}

	public XenResource() {

	}

	public XenResource(int id, String name) {
		this();
		this.id = id;
		this.name = name;
		this.nodeLabel = name;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public ResourcePrototype getResourcePrototype() {
		return resourcePrototype;
	}

	public void setResourcePrototype(ResourcePrototype resourcePrototype) {
		this.resourcePrototype = resourcePrototype;
	}

	public void addChild(XenResource child) {
		if (children == null) {
			this.children = new ArrayList<XenResource>();
		}
		this.children.add(child);
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public String getNodeLabel() {
		return nodeLabel;
	}

	public void setNodeLabel(String nodeLabel) {
		this.nodeLabel = nodeLabel;
	}
}
